import { $get, $delete } from '@js/request'
import { FileSchema } from '@src/components/schema/fileSchema'
import { PDFTemplateSchema } from '@components/schema/pdf';

export async function getTemplateFileRequest (id: string): Promise<FileSchema> {
  const res = await $get(`/api/commission/file_template/${id}`)
  return res.data
}

export async function delRequest (id: string): Promise<void> {
  const res = await $delete(`/api/commission/file_template/${id}`)
  return res.data
}

export async function getTemplateListRequest (): Promise<PDFTemplateSchema[]> {
  const res = await $get('/api/commission/file_template', {
    page: 1,
    limit: 100000
  })
  return res.data.list
}
